<template>
  <div class="main">
    <header>

    </header>
    <section class="content">
      <div class="contentLeft">
        <div class="myAudist">
          <div class="frontTitle" style="width:90%;position: relative">
            <span>我的审核</span>
            <hr/>
          </div>
          <div>
            <ul class="AudistUl" style="margin-top:2px;margin-left:6px; width:100%;">
              <li style="font-size: 12px;color: #a23d0b"><span>申请编号</span><span>申请人</span><span>申请类型</span><span>审核状态</span><span>审核时间</span><span>申请时间</span></li>
              <li v-for="(audist,index) in audists" style="font-size: 11px;color: #504e4d;margin-top:6px;">
                <span>{{audist.applyno}}</span><span>{{audist.admin.adname}}</span><span>{{audist.autype}}</span><span>{{audist.austatusstring}}</span><span v-text="dateFormat(audist.updatetime,'yyyy-MM-dd HH:mm')"></span><span v-text="dateFormat(audist.createtime,'yyyy-MM-dd HH:mm')"></span>
              </li>
            </ul>
            <el-pagination
              background
              layout="prev, pager, next"
              @current-change="currPageChangeByAudist"
              :current-page.sync="pageInfo.currPage"
              :pageSize="pageInfo.pageSize"
              :total="pageInfo.itemCount">
            </el-pagination>
          </div>
        </div>
      </div>
      <div class="contentRight">
        <div class="info" style="position:relative">
          <div class="photo" style="position: absolute;width:100px;height: 120px;top:10px;left:10px">
            <img :src="getImgUrl(admin.adhead)" style="width:100px;height: 120px;">
          </div>
          <ul class="infoUl" style="position: absolute;top:10px;left:114px; width:210px;">
            <li><span>姓名：</span><span>{{admin.adname}}</span></li>
            <li><span>别名：</span><span>{{admin.adnickname}}</span></li>
            <li><span>性别：</span><span>{{admin.adsex}}</span></li>
            <li><span>联系电话：</span><span>{{admin.adphone}}</span></li>
            <li><span>电子邮件：</span><span>{{admin.email}}</span></li>
          </ul>
        </div>
        <div class="myTeachers">
          <div class="frontTitle" style="width:90%;position: relative">
<!--            <span>我的老师</span>-->
<!--            <hr/>-->
          </div>
        </div>
      </div>
    </section>
    <footer>

    </footer>

  </div>
</template>

<script>
import api from "../../../../axios/api"
import * as fecha from "element-ui/lib/utils/date";
import utilsFD from "../../../../static/js/utils/index.js"
export default {
  name: "me",
  data(){
    return {
      admin:{},
      pageInfo:{"pageSize":5,"currPage":1},
      currPage:1,
      audists:{}
    }
  },
  methods:{
    //根据id查询管理员信息
    getAdminById:function(){
      let _this = this;
      api.setDataFromAxios("/api/administratorsController/getAdminById/" + this.admin.adid,null,"get",null).then(
        //默认返回就是response对象
        dto=>{
          _this.admin = dto.t;
          //处理图片字段的地址 变成对应的file 对象 el-upload才能匹配显示
          if(this.admin.adhead!=null&&this.admin.adhead!=''){
            this.oldImg = true;
            let urls = this.admin.adhead.split(",");
          }
          this.admin.updatetime = utilsFD.FD.Fd().dateFormatCN(this.admin.updatetime,'yyyy-MM-dd',fecha);
          this.admin.createtime = utilsFD.FD.Fd().dateFormatCN(this.admin.createtime,'yyyy-MM-dd',fecha);
        }
      )
    },
    //根据id查询审核信息
    getAudistsById:function(){
      let _this = this;
      api.setDataFromAxios("/api/audistController/selectAuditsByAdidAndByPage",{"currPage":this.pageInfo.currPage,"pageSize":this.pageInfo.pageSize,"conditions":{"adid":this.admin.adid}},"post",null).then(
        //默认返回就是response对象
        dto=>{
          _this.audists = dto.tList;
          this.pageInfo = dto.obj;
        }
      )
    },
    currPageChangeByAudist:function () {
      this.getAudistsById();//当用户选择页码，选中的页码自动同步给currPage，再调用重新分页查询当前页方法
    },
    getImgUrl: function (imgsrc) {
      return "../../../../../static/images/admin/upload/head/" + imgsrc;
    },
    dateFormat(cellValue,pattern) {
      return utilsFD.FD.Fd().dateFormatCN(cellValue,pattern,fecha);
    }
  },
  created() {
    this.admin.adid = "1";
    this.getAdminById();
    this.getAudistsById();
  }
}
</script>

<style scoped lang="stylus">
div
  border solid 0px;
.main
  font-family "微软雅黑"
  width 1000px;
  height auto;
  margin 0 auto;
  header
    height 40px;
  .content
    width 1004px;
    height 100%
    div
      float left;
    .frontTitle
      margin 0;
      color: white
      font-size 12px;
      height 24px;
      text-align left;
      span
        text-align center;
        vertical-align center;
        background-color #009af3
        display inline-block;
        width 70px;
        height 18px;
        margin 2px 0 2px 6px;
        border-radius 4px 4px 0 0;
      hr
        border-top 0;
        border-bottom solid 1px  #009af3;
        margin 0 0 0 6px;
        position absolute;
        bottom 3px;
        width 90%


    .contentLeft
      width 690px;
      height 660px;
      div
        margin-top 6px;
        width 100%
      .myAudist
        height 240px;
        .AudistUl
          padding-left 40px;
          li
            list-style-type none
            text-align left
            span
              display inline-block
              text-align center
              &:nth-child(1)
                width 50px;
              &:nth-child(2)
                width 80px;
              &:nth-child(3)
                width 60px;
              &:nth-child(4)
                width 80px;
              &:nth-child(5)
                width 120px;
              &:nth-child(6)
                width 120px;
              //&:nth-child(7)
              //  width 120px;
    //  .myClassmate
    //    height 360px;
    //    .classMateUl
    //      width 90%
    //      margin 0
    //      padding 0
    //      li
    //        font-size 12px;
    //        width 79px;
    //        list-style-type none
    //        margin-left 21px;
    //        float left
    //        .imgDiv
    //          width 79px;
    //          img
    //            width 79px;
    //      &:after
    //        clear both
    //        content ''
    //        display block
    //  .myCostRecord
    //    height 320px;
    //
    .contentRight
      margin-left 10px
      width 300px;
      height 300px;
      div
        width 100%
      .info
        height 258px
        .photo
          width
        .infoUl
          margin 0
          padding 0
          li
            font-size 12px
            list-style-type none
            text-align left
            padding-left 4px
            span
              display inline-block
              height 26px
              &:nth-child(1)
                width 80px
    //  .myTeachers
    //    height  auto
  footer
    height 80px;
</style>
